package com.hktf.corelib.utils;

import org.json.JSONException;
import org.json.JSONObject;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Description: 记录诊断盒连接的收发命令时，创建头部分
 * author: hexunwu
 * date: 2017/1/11 13:55.
 */
public class CreateVDILogUtils {
    public static String createActLog(String event, String title) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time = format.format(new Date());
        int eventInt = Integer.parseInt(event);
        String actLog = "";
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.put("event",eventInt);
            jsonObject.put("title",title);
            jsonObject.put("time",time);
            actLog = jsonObject.toString();
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return actLog;
    }
}
